<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <div v-html="msg2">
            46134465
        </div>
        <p v-text="msg">494974894489{{msg}}</p>
        <!-- v-bind绑定属性指令 title(属性)="mytitle"（属性值） 会把属性值看作js变量解析而不是字符串-->
        <!-- 简写 v-bind:=:  -->
        <input type="button" value="按钮" title="mytitle">
        <input type="button" value="按钮" v-bind:title="mytitle">
        <input type="button" value="按钮" v-bind:title="mytitle+1324">
        <input type="button" value="按钮" :title="mytitle">
        <!-- v-on事件绑定指令 直接绑定一个方法名称 -->
        <input type="button" value="按钮" :title="mytitle" v-on:click="sayHi">

        <!-- 也可以调用方法： -->
        <input type="button" value="按钮" :title="mytitle" v-on:click="sayEverything('hahahha')">
        
        <!-- 简写 v-on:=@-->
        <input type="button" value="按钮1" :title="mytitle" @mouseover="sayEverything('say what')">

    </div>
    <script src="../node_modules/vue/dist/vue.js"></script>
    <script>
        var vm = new Vue({
            el: '#app',
            data() {
                return {
                    msg: 123,
                    msg2: " <h1>我是文本</h1>",
                    mytitle: "这是自己定义的title",
                    mytitle2: '12364'
                }
            },
            methods: {
                sayHi: function () {
                    window.alert('hihihi')
                },
                sayEverything: function (a) {
                    window.alert(a)
                }
            }
        })
    </script>
</body>

</html>